package com.example.hello.service.controller;

import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

import com.example.hello.service.api.model.User;
import com.example.hello.service.api.service.HelloService;

@RestController
public class RefactorHelloController implements HelloService{

	@Override
	public String hello() {
		return "Hello World !";
	}

	@Override
	public String hello(String name) {
		return "Hello ," + name ;
	}

	@Override
	public User hello(@RequestHeader("name") String name, @RequestHeader("age")Integer age) {
		return new User(name,age);
	}

	@Override
	public String hello(User user) {
		return "Hello "+user.getUserName()+", "+user.getAge();
	}

}
